package servlet.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import servlet.bean.CourseBean;
import servlet.bean.TeacherBean;
import servlet.model.ServiceFactory;
import servlet.publicUtils.MyUtils;

public class CouTempServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		//request.setCharacterEncoding("UTF-8");
		String strOperationType = request.getParameter("opt");
		int iOpt = MyUtils.ObjtoInt(strOperationType);
		
		
		CourseBean couB = (CourseBean) MyUtils.getNewInstance(CourseBean.class);
		couB.setCou_name(request.getParameter("stucourse"));
		List<CourseBean> lstCou=ServiceFactory.getUserInfoManagerServiceInstance().getCou();
		request.getSession().setAttribute("lstCou", lstCou);
		//判断是否进入哪个界面
		if(iOpt==0){
		String strJumpPage = "logined/teaCouInfo.jsp";
		// 跳转到修改页面
		request.getRequestDispatcher(strJumpPage).forward(request, response);
		}
		
		
	}

}
